#参数，数据计算

from config import *
import librosa
import numpy as np










# 波峰宽度width计算
def fun_width():
    """
    60s数据长300mmm
    波峰宽度5-7mm
    """
    w = RATE*60*(5/300)
    width = [int(w*0.5),int(w*1.5)]
    print(width)

#height最低值计算，最高值建议取0.1
def fun_height():
    y, sr = librosa.load('../demo_data/output20250512-065956.mp3', dtype='float32',sr=44100  )
    y_positive_only = y[y > 0]
    print(np.max(y_positive_only)) #height最底值 0.004
